using System.ComponentModel.DataAnnotations;

namespace WebApplication1.Implement.DTO
{
    /// <summary>
    /// 聊天消息请求DTO
    /// </summary>
    public class ChatMessageRequestDto
    {
        /// <summary>
        /// 用户消息内容
        /// </summary>
        [Required(ErrorMessage = "消息内容不能为空")]
        public string Message { get; set; } = string.Empty;


        /// <summary>
        /// 用户ID（可选）
        /// </summary>
        public string? UserId { get; set; }
    }

    /// <summary>
    /// 聊天消息响应DTO
    /// </summary>
    public class ChatMessageResponseDto
    {
        /// <summary>
        /// AI回复内容
        /// </summary>
        public string Reply { get; set; } = string.Empty;

        /// <summary>
        /// 会话ID
        /// </summary>
        public string SessionId { get; set; } = string.Empty;

        /// <summary>
        /// 响应时间戳
        /// </summary>
        public DateTime Timestamp { get; set; } = DateTime.Now;

        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success { get; set; } = true;

        /// <summary>
        /// 错误信息（如果有）
        /// </summary>
        public string? ErrorMessage { get; set; }
    }

    /// <summary>
    /// 聊天历史记录DTO
    /// </summary>
    public class ChatHistoryDto
    {
        /// <summary>
        /// 消息ID
        /// </summary>
        public string MessageId { get; set; } = string.Empty;

        /// <summary>
        /// 会话ID
        /// </summary>
        public string SessionId { get; set; } = string.Empty;

        /// <summary>
        /// 用户消息
        /// </summary>
        public string UserMessage { get; set; } = string.Empty;

        /// <summary>
        /// AI回复
        /// </summary>
        public string BotReply { get; set; } = string.Empty;

        /// <summary>
        /// 消息类型
        /// </summary>
        public string MessageType { get; set; } = string.Empty;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; } = DateTime.Now;
    }
}
